<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Dog(name, gender) {
            this.name = name
            this.gender = gender
        }
        Dog.prototype.jiao = function() {
            console.log(this.name + '汪汪')
        }

        let dog1 = new Dog('黄', "公")
        let dog2 = new Dog('绿', '母')

        console.log(dog1)
        dog1.jiao()

        console.log(dog2)
        setInterval(function() {
            dog2.jiao()
        }, 1000)




    </script>
</body>
</html>